package me.wangjian.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;

/**
 * 身份证实体
 * Created by wangjian on 16/8/25.
 */
@Entity
@Table(name = "t_idcard")
public class IdCard {

    @Id
    @Column(length = 18)
    private String cardNum;
    private String nativePlace;

    @OneToOne(mappedBy = "idCard")
    private User user;

    public IdCard() {
    }

    public IdCard(String cardNum,String nativePlace) {
        this.cardNum = cardNum;
        this.nativePlace = nativePlace;
    }

    public IdCard(String cardNum, String nativePlace, User user) {
        this.cardNum = cardNum;
        this.nativePlace = nativePlace;
        this.user = user;
    }

    public String getCardNum() {
        return cardNum;
    }

    public void setCardNum(String cardNum) {
        this.cardNum = cardNum;
    }

    public String getNativePlace() {
        return nativePlace;
    }

    public void setNativePlace(String nativePlace) {
        this.nativePlace = nativePlace;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
